<template>
	<view class="container-teacher">
		<tab-indicator :tabs="tabs" :activeIndex="activeIndex" @tabSelected="tabSelected"></tab-indicator>
		<exam-report :class="[activeIndex==examIndex?'show':'hide']" :parentIndex="activeIndex" :selfIndex="examIndex" :ascription="ascription"></exam-report>
		<student-report :class="[activeIndex==studentIndex?'show':'hide']" :parentIndex="activeIndex" :selfIndex="studentIndex" :ascription="ascription"></student-report>
		<!-- <swiper @change="changeTab" :current="activeIndex" class="swiper">
			<swiper-item class="swiper-item">
				<exam-report :parentIndex="activeIndex" :selfIndex="examIndex" :ascription="ascription"></exam-report>
			</swiper-item>
			<swiper-item>
				<student-report :parentIndex="activeIndex" :selfIndex="studentIndex" :ascription="ascription"></student-report>
			</swiper-item>
		</swiper> -->
	</view>
</template>
<script>
	import TabIndicator from './fragments/TabIndicator';
	import ExamReport from './tabs/ExamReport';
	import StudentReport from './tabs/StudentReport';
	import user from '@/mixins/user/index'
	export default {
		components: {
			TabIndicator,
			ExamReport,
			StudentReport
		},
		mixins:[user],
		data() {
			return {
				ascription:0,
				examIndex:0,
				studentIndex:1,
				activeIndex: 0,
				tabs: ["考试数据", "考生数据"]
			}
		},
		onLoad(query) {
			this.ascription = query.ascription;
		},
		methods: {
			tabSelected(index) {
				this.activeIndex = index;
			},
			changeTab(e) {
				this.activeIndex = e.target.current
			}
		}
	}
</script>
<style lang="scss" scoped>
	.swiper {
		height: calc(100vh - 80upx);
		overflow-y: scroll;
	}
	.swiper-item{
		height: calc(100vh - 80upx);
		overflow-y: scroll;
	}
	.show{
		display: block;
		height: calc(100vh - 80upx);
		overflow-y: scroll;
		position: relative;
	}
	.hide{
		display: none;
	}
</style>
